package com.yanqu.road.server.cmd.activity.zhenhuan;

import com.yanqu.road.entity.activity.ActivityInfo;
import com.yanqu.road.entity.enums.activity.zhenhuan.eZhenHuanChildType;
import com.yanqu.road.entity.enums.eActivityType;
import com.yanqu.road.message.YanQuMessage;
import com.yanqu.road.pb.activity.ZhenHuanProto;
import com.yanqu.road.server.cmd.base.AbstractCommand;
import com.yanqu.road.server.command.Cmd;
import com.yanqu.road.server.gameplayer.GamePlayer;
import com.yanqu.road.server.gameplayer.module.activity.ActivityWorshipModule;
import com.yanqu.road.server.gameplayer.module.activity.zhenhuan.ZhenHuanFirstProcessModule;
import com.yanqu.road.server.gameplayer.module.activity.zhenhuan.ZhenHuanSecondProcessModule;
import com.yanqu.road.server.gameplayer.module.activity.zhenhuan.ZhenHuanThirdProcessModule;
import com.yanqu.road.server.manger.activity.ActivityMgr;
import com.yanqu.road.server.protocol.ClientProtocol;
import com.yanqu.road.server.protocol.GameErrorCode;
import com.yanqu.road.server.protocol.Protocol;
import org.apache.regexp.RE;

@Cmd(code = Protocol.S_ZHENHUAN_WORSHIP, desc = "甄嬛膜拜")
public class ZhenHuanWorshipCmd extends AbstractCommand {

    @Override
    public boolean parseData(YanQuMessage packet) throws Exception {
        return true;
    }

    @Override
    public void execute(GamePlayer player, YanQuMessage packet) throws Exception {
        ZhenHuanProto.ZhenHuanWorshipReqMsg reqMsg = ZhenHuanProto.ZhenHuanWorshipReqMsg.parseFrom(packet.getBytes());
        int activityId = reqMsg.getActivityId();

        ret = player.getModule(ActivityWorshipModule.class).worship(activityId);
    }

    @Override
    public void sendData(GamePlayer player) {
        if (ret > 0) {
            player.sendPacket(ClientProtocol.U_ZHENHUAN_WORSHIP, ZhenHuanProto.ZhenHuanFirstProcessChoseRespMsg.newBuilder().setRet(ret));
        }
    }

}
